package com.codeforces;

import java.util.Scanner;

public class _122A {

	static int N;
	static int[] n = {4,7,44,47,74,77,444,447,474,477,744,747,774,777};

	public static void main(String[] args) throws Exception {
		Scanner scanner = new Scanner(System.in);
		N = scanner.nextInt();
		boolean flag = false;
		for (int i=0;i<n.length;++i) {
			if (N % n[i] == 0) {
				flag = true;
				break;
			}
		}
		
		if (flag) {
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}

	}

}
